// history模式
import {
    createRouter,
    createWebHashHistory,
} from 'vue-router'
import Home from '../pages/Home.vue'
import About from '../pages/About.vue'
import Login from '../pages/Login.vue'
const routes = [
    // 路由的默认路径
    {
        path: '/',
        redirect: "/works"
    },
    {
        path: '/home',
        component: Home
    },
    {
        path: '/about',
        component: About
    },
    {
        path: '/login',
        component: Login,
        meta: {
            titleMobile: false,
        }
    },
    {
        path: '/register',
        name: '注册',
        component: () => import('@/pages/Register.vue'),
        meta: {
            titleMobile: true,
        }
    },
    {
        path: '/agree',
        component: () => import('@/pages/agree/Agree.vue'),
    },
    {
        path: '/album',
        component: () => import('@/pages/album/Album.vue'),
        meta: {
            title: '我的相册',
            // keepAlive: true, // 需要缓存

        }
    },
    {
        path: '/albumshare',
        component: () => import('@/pages/album/AlbumShare.vue'),
        meta: {

        }
    },
    {
        path: '/album/vo/:albumId',
        name: '相册详情',
        component: () => import('@/pages/album/AlbumVo.vue'),
        meta: {
            keepAlive: false,
            titleMobile: true,
        }
    },
    {
        path: '/albumview',
        name: '相册',
        component: () => import('@/pages/album/View.vue'),
        meta: {
            titleMobile: true,
        }
    },
    {
        path: '/albumdetect',
        name: '智能分类',
        component: () => import('@/pages/album/AlbumDetect.vue'),
        meta: {
            titleMobile: true,
        }
    },
    {
        path: '/addshareuser/:albumId',
        name: '添加共享相册',
        component: () => import('@/pages/album/AddShareUser.vue'),
        meta: {
            titleMobile: true,
        }
    },
    {
        path: '/photo/:albumId',
        name: 'photo',
        component: () => import('@/pages/photo/Photo.vue'),
    },
    {
        path: '/photoshare/:albumId',
        name: 'photoshare',
        component: () => import('@/pages/photo/PhotoShare.vue'),
    },
    {
        path: '/photodetect/:clas',
        name: 'photodetect',
        component: () => import('@/pages/photo/PhotoDetect.vue'),
    },
    {
        path: '/photorb',
        name: '回收站',
        component: () => import('@/pages/photo/Photorb.vue'),
        meta: {
            titleMobile: true,
        }
    },
    {
        path: '/viewtest',
        name: 'viewtest',
        component: () => import('@/pages/ViewTest.vue'),
    },
    {
        path: '/nav',
        name: 'nav',
        component: () => import('@/components/NavMobile.vue'),
    },
    {
        path: '/mine',
        name: '我的',
        component: () => import('@/pages/mine/Mine.vue'),
        meta: {
            keepAlive: false,
            titleMobile: true,
        }
    },
    {
        path: '/mineinfo',
        name: '我的信息',
        component: () => import('@/pages/mine/MineInfo.vue'),
        meta: {
            keepAlive: false,
            titleMobile: true,
        }
    },
    {
        path: '/updatepwd',
        name: '密码修改',
        component: () => import('@/pages/mine/UpdatePWD.vue'),
        meta: {
            keepAlive: false,
            titleMobile: true,
        }
    },
    {
        path: '/updatephone/:phone',
        name: '手机号绑定',
        component: () => import('@/pages/mine/UpdatePhone.vue'),
        meta: {
            keepAlive: false,
            titleMobile: true,
        }
    },
    {
        path: '/user/info/:userId',
        name: '用户详情',
        component: () => import('@/pages/user/UserInfo.vue'),
        meta: {
            titleMobile: true,
        }
    },
    {
        path: '/user/likefan/:userId',
        name: '关注与粉丝',
        component: () => import('@/pages/user/LikeFan.vue'),
        meta: {
            titleMobile: true,
        }
    },
    {
        path: '/setting',
        name: '设置',
        component: () => import('@/pages/setting/Setting.vue'),
        meta: {
            titleMobile: true,
        }
    },
    {
        path: '/collection',
        name: '收藏',
        component: () => import('@/pages/mine/Collection.vue'),
        meta: {
            titleMobile: true,
        }
    },
    {
        path: '/report',
        name: '帮助与反馈',
        component: () => import('@/pages/mine/Report.vue'),
        meta: {
            titleMobile: true,
        }
    },
    {
        path: '/backto',
        name: 'backto',
        component: () => import('@/components/BackTo.vue'),
    },
    {
        path: "/myempty",
        component: () => import('@/components/MyEmpty.vue'),
    },

    {
        path: "/baidugide",
        component: () => import('@/components/BaiduGide.vue'),
        name: "地图"
    },
    {
        path: "/works/upload",
        component: () => import('@/pages/works/Upload.vue'),
        name: "上传",
        meta: {
            titleMobile: true,
        }
    },
    {
        path: "/works/show/:worksId",
        component: () => import('@/pages/works/Show.vue'),
        name: "作品详情",
        meta: {
            navMobile: false,
        }
    },
    {
        path: "/works",
        component: () => import('@/pages/works/Works.vue'),
        name: "作品列表",
    },
    {
        path: "/worksview",
        component: () => import('@/pages/works/WorksView.vue'),
        name: "作品中心",
        meta: {
            navMobile: true,
            titleMobile: true,
        }
    },
    {
        path: "/history",
        component: () => import('@/pages/mine/LookHistory.vue'),
        name: "浏览历史",
        meta: {
            titleMobile: true,
        }
    },
    {
        path: "/vip",
        component: () => import('@/pages/mine/Vip.vue'),
        name: "会员",
        meta: {
            titleMobile: true,
            navMobile: false,
        }
    },
    {
        path: "/message",
        component: () => import('@/pages/message/Message.vue'),
        name: "消息中心",
        meta: {
            titleMobile: true,
        }
    },
    {
        path: '/messageinfo/:groupId/:receiveId/:type',
        component: () => import('@/pages/message/MessageInfo.vue'),
        name: "messageinfo",
        meta: {
            // titleMobile: true,
            navMobile: false,
        }
    },
]

// 创建路由对象
const router = createRouter({
    history: createWebHashHistory(),
    routes
})
export default router;